package cn.hchaojie.camp.day06;

public class DemoRunnable {
	public static void main(String[] args) {
		// 定义类和实现接口一步到位
		// 
		Runnable r = new Runnable() {
			@Override
			public void run() {
				System.out.println("我正在跑后台任务。。。");
			}
			
		};

		// Thread thread = new Thread(r);
		// 匿名内部类
		Thread thread = new Thread(new Runnable() {
			@Override
			public void run() {
				System.out.println("======");
			}
		});
		
		Thread thread2 = new Thread(new Runnable() {
			@Override
			public void run() {
				System.out.println("++++++");
			}
		});
		
		Thread thread3 = new Thread(() -> {
			System.out.println("********");
		});
		thread2.start();
		thread3.start();
		thread.start();
	}
}

